/*
package com.jml.config;

import org.apache.commons.lang3.StringUtils;
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;


*/
/**
 * 配置RedissonConfig配置
 *//*

@Configuration
public class RedissonConfig {
    @Value("${spring.redis.host:}")
    private String host;
    @Value("${spring.redis.port:}")
    private String port;

    @Value("${spring.redis.cluster.nodes:}")
    private   String  redisNodes;
    @Value("${spring.redis.password:}")
    private String password;




    @Bean
    public RedissonClient getRedisson() {
        Config config = new Config();
        //设置看门狗时间 续命线程定时间隔时间
//        config.setLockWatchdogTimeout(100000000);
        //单机
        if(StringUtils.isNotBlank(host)){
            config.useSingleServer().setAddress("redis://" + host + ":" + port).setPassword(password);
            //cluster集群
        }else if(StringUtils.isNotBlank(redisNodes)){
            config.useClusterServers().addNodeAddress("redis://" + redisNodes).setPassword(password);
            //主从
        }else{
            throw new RuntimeException("11111");
        }

        //设置单机版本redis
        */
/*config.useSingleServer().setAddress("redis://" + host + ":" + port);*//*

        //设置集群的方式

        //添加主从配置
//        config.useMasterSlaveServers().setMasterAddress("").setPassword("").addSlaveAddress(new String[]{"",""});
        return Redisson.create(config);
    }
}*/
